package org.ali.structuralpattern.filterpattern.filter;

import org.ali.structuralpattern.filterpattern.Graph;

import java.util.List;

/**
 * 过滤器
 */
public class FilterCircularAndRed implements Filter {
    private final FilterCircular filterCircular;
    private final FilterRed filterRed;

    public FilterCircularAndRed(FilterCircular filterCircular, FilterRed filterRed) {
        this.filterCircular = filterCircular;
        this.filterRed = filterRed;
    }

    @Override
    public List<Graph> filter(List<Graph> graphs) {
        List<Graph> circularGraphs = filterCircular.filter(graphs);
        return filterRed.filter(circularGraphs);
    }
}
